<!DOCTYPE html>
<html lang="en">
<head>
<title>TFY FOREX</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="TFY" />
<meta name="keywords" content="TFY" />
<link rel="stylesheet" href="resources/css/bootstrap.css" />
<link rel="icon" href="/upload/images/logo.ico" type="image/x-icon" />
<style>
body{
	background-color: #0d1727;
}
img{
	width: 100%; 
	height: auto;
}

#form{
	
	background-size: cover;
	padding: 10px 50px;
	text-align: center;
}

#form input{
	margin: 20px 0;
}
.myBtn{
    color: #fff;
    background-color: #e7600c;
    border-radius: 3px;
    padding: 10px 30px;
    width: 100%; 
    display: block;
    font-size: 1.2em;
}

.myBtn:active, .myBtn:hover, .myBtn:visited{
    color: #fff;
    background-color: #e7600c;
    border-radius: 3px;
    padding: 10px 30px;
    width: 100%; 
    display: block;
    text-decoration: none;
}

.myBtn1{
    color: #fff;
    background-color: #e7600c;
    border-radius: 3px;
    padding: 10px 30px;
    width: 50%; 
    display: inline-block;
    font-size: 1.2em;
}

.myBtn1:active, .myBtn1:hover, .myBtn1:visited{
    color: #fff;
    background-color: #e7600c;
    border-radius: 3px;
    padding: 10px 30px;
    width: 100%; 
    text-decoration: none;
}

.myContainer{
	padding-bottom: 3px;
}
.myContainer .col-xs-6{
	padding: 0 30px;
}

table {
	width: 100%;
	font-weight: bold;
}

table td{
	line-height: 60px;
	padding: 0 10px;
}

table input {
	border: solid #cfcfcf 1px;
	border-radius: 3px;
	line-height: 40px;
}

html {
	height: 100%;
}

body{
	width: 100%;
	height: 100%;
	
	/*background: url(upload/images/mobile/tfy2/23.jpg) top center no-repeat;*/
	background-size: cover;
}

.inner1{
	min-height: 200px;
	text-align: center;
	padding: 30px 0 30px 0;
}

.inner1 span {
	font-size: 2em;
	font-weight: bold;
	color: #fff;
}

.inner1 span em{
	color: #ff6200;
}

.formItemWrapper{
	margin: 20px 20px;
	border: solid #aaa 1px;
	border-radius: 3px;
	padding: 10px;
	text-align: left;
	color: #666;
	background-color: #fff;
}

.formItemWrapper img {
	width: auto;
}

.formItemWrapper input {
	width: 120px;
	border: none;
	outline: none;
}

.formItemWrapper1{
	margin: 20px 20px;
	border: solid #aaa 2px;
	border-radius: 3px;
	padding: 10px;
	text-align: center;
	color: #fff;
	background-color: #ff6200;
	border: none;
	cursor: pointer;
}
</style>
</head>
<body>
	<a href="aboutmobile.html">
	<img src="upload/images/mobile/tfy2/1.jpg" />
	</a>
	<img src="upload/images/mobile/download1.jpg" />
	<a href="https://itunes.apple.com/cn/app/metatrader-4/id496212596?utm_campaign=www.metatrader4.com">
	<img src="upload/images/mobile/download2.jpg" />
	</a>
	<a href="http://inviteyou.cn/upload/files/softwares/tfyforexmetatrader4.apk">
	<img src="upload/images/mobile/download3.jpg" />
	</a>
	<div class="container container1">
	<div class="inner1">
		<br /><br /><br />
		
		<span>免费领取<em>$10,000</em>体验金</span><br />
		<br />
		<div class="formItemWrapper">
		姓名: <input name="name" id="name" placeholder="您的姓名" />
		</div>
		<div class="formItemWrapper">
		手机: <input type="number" name="mobile" id="mobile" placeholder="您的手机号"  />
		</div>
		<div class="formItemWrapper verifyCode">
		验证: <input type="number" name="code" id="code" placeholder="请输入验证码" />
		<button id="btnGetVerifyCode" class="btn btn-sm btn-primary" style="float: right; vertical-align: middle; margin-top: -2px;">发送验证码</button>
		<!--img id="verifyCodeImage" src="genCaptcha" title="点击刷新验证码" /-->
		</div>
		<div class="formItemWrapper1" id="btnSubmit">
			免费体验
		</div>
	</div>
</div>
	<div class="container" style="text-align: center; width: 100%; position: fixed; bottom: 10px;">
		<span>Copyright &copy; 2017 Tactical Global, All Rights Reserved</span>
	</div>
</body>
<script src="resources/js/jquery-2.1.4.js"></script>
<script>


$('#btnSubmit').click(function(){
	var name = $('#name').val();
	var mobile = $('#mobile').val();
	var code = $('#code').val();
	
	if(name=='') {
		alert('请输入您的姓名');
		return;
	}
	

	if(mobile=='' || !/\d{11,11}/.test(mobile)) {
		alert('请输入您的手机号码');
		return;
	}
	
	if(code=='') {
		alert('请输入验证码');
		return;
	}
	
	$.ajax({
		url: 'userInfo/add',
		type: 'post',
		data: {'name': name, 'mobile': mobile, 'code': code},
		success: function(data){
			if(data=='BADCODE') {
				alert('验证码错误, 请重新输入');
				return;
			}
			alert('提交成功, 请保持手机畅通, 工作人员会联系您.')
			$('#name').val('');
			$('#mobile').val('');
			$('#code').val('');
		},
		error: function(){
			alert('操作失败, 请稍后重试');
		}
	})
});

$('#verifyCodeImage').click(function(){
	$(this).attr('src', 'genCaptcha?v=' + new Date());
});

$('#btnGetVerifyCode').click(function(){
	var that = $(this);
	var mobile = $('#mobile').val();
	if(mobile=='' || !/\d{11,11}/.test(mobile)) {
		alert('请输入正确的手机号码');
		return;
	}
	
	$.ajax({
		url: 'sendVerifyCode?mobile=' + mobile,
		success: function() {
			$(that).attr('disabled', true);
			var count = 59;
			var timer = setInterval(function(){
				$(that).text(count);
				count--;
				if(count<=0) {
					$(that).attr('disabled', false);
					$(that).text('发送验证码');
					clearInterval(timer);
				}
			}, 1000)
		},
		error: function(){
			alert('获取验证码失败, 请稍后重试');
		}
	})
});


$('.formItemWrapper').click(function(){
	$(this).find('input').focus();
});
</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?62f3c3ef3b75268eb64da8b728220266";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</html>